function theta2Reduced = reduceTheta2(theta2,namesReduced)

namesTheta2 = fieldnames(theta2);
posTheta2Reduced = zeros(1,length(namesReduced));
for i=1:length(namesReduced)
    posTheta2Reduced(1,i) = find(strcmp(namesTheta2,namesReduced(i)));
end
theta2Values  = struct2array(theta2)';
theta2ValuesReduced = theta2Values(posTheta2Reduced');
theta2Reduced = values2struct(theta2ValuesReduced,namesReduced);


end

